/*
 * Copyright (C) 2012 Richard Schilling
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package dalvik.vm.analysis;

/**
 * A representation of privitive types. The names of each enum is prefixed with
 * PRIM_ so that it's visually easy to see that the enumeration refers to a
 * primitive.
 * 
 * @author rschilling
 */
public enum PrimitiveType {
    PRIM_BOOLEAN(1),
    PRIM_BYTE(8),
    PRIM_SHORT(16),
    PRIM_CHAR(16),
    PRIM_INT(32),
    PRIM_LONG(64),
    PRIM_FLOAT(64),
    PRIM_DOUBLE(64),
    PRIM_VOID(0);

    /**
     * Number of bits this object takes up in memory.
     */
    private int bitCount;

    private PrimitiveType(int bits) {
        bitCount = bits;
    }

    public int sizeOf() {
        return bitCount;
    }

}
